<template>
    <div>
        <h1>我是登录页面</h1>
        <label>账号: <input v-model="userObj.user" type="text"> </label><br />
        <label>密码: <input v-model="userObj.pwd" type="text"> </label><br />
        <button @click="loginUser">登录</button>
    </div>
</template>

<script>
    import utils from '../utils/utils.js'
    export default {
        name: 'login',
        data() {
            return {
                userObj: {
                    user: '',
                    pwd: ''
                }
            }
        },
        methods: {
            loginUser() {
                let { user, pwd } = this.userObj
                utils.setStorage('user', this.userObj)
                this.$router.push('/home')
            }
        }
    }
</script>

<style>
</style>